<?php

use yii\helpers\Url;
use app\modules\admin\models\StatusEnum;

?>
<?php foreach ($menus as $item): ?>
    <li class="treeview aleftMenu <?= $item['cate']['is_show'] == StatusEnum::ENABLED ? '' : 'hide' ?> aleftMenu-<?= $item['cate_id'] ?>">
        <?php if (!empty($item['-'])): ?>
            <a href="#">
                <i class="fa fa-<?= $level == 1 ? $item['icon'] : 'circle-o' ?>"></i>
                <span><?= $item['name'] ?></span>
                <span class="pull-right-container">
                    <i class="fa fa-angle-left pull-right"></i>
                </span>
            </a>
            <ul class="treeview-menu">
                <?= $this->render('menu-tree', [
                    'menus' => $item['-'],
                    'level' => $level + 1,
                ])?>
            </ul>
        <?php else: ?>
            <a class="J_menuItem" href="<?= Url::toRoute($item['url']); ?>">
                <i class="fa fa-<?= $level == 1 ? $item['icon'] : 'circle-o'; ?>"></i>
                <span><?= $item['name']; ?></span>
            </a>
        <?php endif; ?>
    </li>
<?php endforeach; ?>
